Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

feat: a precompile to get ciphertext bytes #90

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

dartdart26
Copy link
Contributor

@dartdart26 dartdart26 commented Feb 21, 2024

Given a contract address and an ebool/euint value stored in it, return the underlying ciphertext.

Returns an empty response if no such ciphertext exist. Only works via eth_call.

The function selector for it, as of this commit, is e4b808cb.

Move protected storage code into its own file.

Add a FheLib Library section in the getting started doc section.

Nit: rename arg_types to argTypes in instructions.go for naming consistency.

@dartdart26
Copy link
Contributor Author

Resolves #75.

@dartdart26 dartdart26 force-pushed the petar/get-ciphertext-precompile branch from 1eb0838 to 3eb3802 Compare February 21, 2024 16:32
Copy link
Member

@youben11 youben11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FheLib documentation is perfect

@youben11 youben11 requested a review from aquint-zama February 21, 2024 16:40
@aquint-zama
Copy link
Contributor

We should have a gitbook preview but I don't find it...

@dartdart26
Copy link
Contributor Author

We should have a gitbook preview but I don't find it...

How can we add it? Should we do it as a part of a separate PR?

@aquint-zama
Copy link
Contributor

We should have a gitbook preview but I don't find it...

How can we add it? Should we do it as a part of a separate PR?

normally it's automatic, I'll check.

@aquint-zama
Copy link
Contributor

We should have a gitbook preview but I don't find it...

How can we add it? Should we do it as a part of a separate PR?

normally it's automatic, I'll check.

Ok it's now enabled, could you amend your last commit and force push to trigger it @dartdart26

Given a contract address and an ebool/euint value stored in it, return
the underlying ciphertext.

Returns an empty response if no such ciphertext exist. Only works via
`eth_call`.

The function selector for it, as of this commit, is `e4b808cb`.

Move protected storage code into its own file.

Add a `FheLib Library` section in the getting started doc section.

Nit: rename `arg_types` to `argTypes` in instructions.go for naming
consistency.
@dartdart26 dartdart26 force-pushed the petar/get-ciphertext-precompile branch from 3eb3802 to 47a5982 Compare February 22, 2024 09:00
@dartdart26
Copy link
Contributor Author

@aquint-zama should we merge?

@tremblaythibaultl
Copy link
Contributor

Good work!

I notice this precompile only returns the ciphertext bytes and no other metadata such as ciphertext type. @youben11 I think the oracle service needs this information; do you think it's possible and sufficient to get it from the oracle smart contract event?

@dartdart26
Copy link
Contributor Author

Good work!

I notice this precompile only returns the ciphertext bytes and no other metadata such as ciphertext type. @youben11 I think the oracle service needs this information; do you think it's possible and sufficient to get it from the oracle smart contract event?

A somewhat hacky way of dealing with that is what we do in the cli tool - determine ciphertext type based on its size. I guess at some point the type should be part of its serialisation. If we want the type, we can append one byte at the beginning or the end.

@youben11
Copy link
Member

Good work!

I notice this precompile only returns the ciphertext bytes and no other metadata such as ciphertext type. @youben11 I think the oracle service needs this information; do you think it's possible and sufficient to get it from the oracle smart contract event?

There has been a change in the events published by the oracle contract, which now specify the type, so the oracle should have this information. Now I'm not sure if this is necessarily enough.

@dartdart26 dartdart26 merged commit 26427fd into main Feb 22, 2024
3 checks passed
@dartdart26 dartdart26 deleted the petar/get-ciphertext-precompile branch February 22, 2024 10:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants